package youcaihuaoa.weetop.com.ui.main

import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.robot.base.base.activity.GLBaseActivity
import com.robot.base.configs.AppConstants
import youcaihuaoa.weetop.com.BR
import youcaihuaoa.weetop.com.R
import youcaihuaoa.weetop.com.databinding.AppActivityBasicInfoBinding
import youcaihuaoa.weetop.com.ui.adapter.WagesProfileItemAdapter
import youcaihuaoa.weetop.com.vm.main.BasicInfoViewModel

@Route(path = AppConstants.Router.Main.A_BASIC_INFO)
class BasicInfoActivity : GLBaseActivity<AppActivityBasicInfoBinding, BasicInfoViewModel>() {

    private lateinit var wagesProfileItemAdapter: WagesProfileItemAdapter

    override fun initComponents() {
        addSingleTitleBar("基本信息")
        wagesProfileItemAdapter = WagesProfileItemAdapter()
        binding.recyclerView1.apply {
            layoutManager = LinearLayoutManager(this@BasicInfoActivity)
            adapter = wagesProfileItemAdapter
        }
        viewModel.initData()
    }

    override fun initContentView(savedInstanceState: Bundle?): Int =
        R.layout.app_activity_basic_info

    override fun initVariableId(): Int = BR.viewModel

    override fun initViewObservable() {
        viewModel.uiEvent.menuDataLiveEvent.observe(this) {
            wagesProfileItemAdapter.setNewInstance(it)
        }
    }
}